<template>
  <div class="user-manage content-bg">
    <el-table :data="tableData"
              border
              :fit="true"
              style="width: 100%">
      <el-table-column label="租客用户名"
                       prop="renterNickName">
      </el-table-column>
      <el-table-column label="租客姓名"
                       prop="userName">
      </el-table-column>
      <el-table-column label="租客身份证号码"
                       prop="renterId">
      </el-table-column>
      <el-table-column label="租客联系电话"
                       prop="phone">
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button size="mini"
                     type="danger"
                     @click="handleDelete(scope.$index, scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="pagination-box">
      <el-pagination background
                     layout="total, prev, pager, next"
                     :total="1000">
      </el-pagination>
    </div>
  </div>
</template>
<script lang="js">
export default {
  name: 'Houselist',
  data(){
    return {
      tableData: [
        {
          renterNickName:'XXXXX',
          userName: 'XXXX',
          renterId: '51346546',
          phone: '157324567879'
        }, {
          renterNickName:'XXXXX',
          userName: 'XXXX',
          renterId: '51346546',
          phone: '157324567879'
        }]
    }
  },
  methods: {
      handleDelete(index, row) {
          this.$confirm('确定要删除吗?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'error'
        }).then(() => {
          // 访问接口
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '取消成功'
          });
        });
      }
    }
}
</script>
<style lang="scss" scoped>
</style>
